#define _CRT_SECURE_NO_WARNINGS 1
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include<math.h>
#include<stdlib.h>
#include<stdio.h>
#include<unordered_map>
#include<queue>
using namespace std;

class Solution {
public:
    vector<vector<string>> groupAnagrams(vector<string>& strs) {
        unordered_map<string, vector<string>> hash;
        for (auto& ch : strs)
        {
            string tmp = ch;
            sort(tmp.begin(), tmp.end());
            hash[tmp].push_back(ch);
        }
        vector<vector<string>> ret;
        for (auto& ch : hash)
            ret.push_back(ch.second);
        return ret;
    }
};

int main() {
    return 0;
}